load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test")

cc_binary(
    name = "dynamic_lib",
    srcs = ["lib.cpp"],
    copts = [
        "-std=c++17",
        "-fPIC",
    ],
    linkshared = True,
    visibility = ["//visibility:private"],
)

cc_test(
    name = "unit_tests",
    srcs = ["tests.cpp"],
    copts = ["-std=c++17"],
    data = [":dynamic_lib"],
    visibility = ["//visibility:private"],
    deps = [
        "@dylib//:dylib",
        "@googletest//:gtest",
        "@googletest//:gtest_main",
    ],
)
